<template>
  <section class="my-container">
    <aside class="bg-white px-4 rounded">
      <h1 class="pt-5 pb-2 text-2xl text-center">{{ news.title }}</h1>
      <p class="border-b border-[#dcdfe6] pb-3 text-sm text-right text-gray-400"
        >{{ format(news.createdAt, 'yyyy-MM-dd HH:mm:ss') }}
      </p>
      <article class="p-5" v-html="news.content"></article>
    </aside>
  </section>
</template>

<script>
  import { format } from 'date-fns'

  export default {
    name: 'NewsDetail',
    data() {
      return {
        format,
      }
    },
    computed: {
      ...mapState('news', ['news']),
    },
  }
</script>

<style></style>
